if SERVER then
	registerCommand("voicemute", "Mutes the voice chat of player you specify's chat text", function(param)
		local muteOn = "caller voice muted target"
		local muteOff = "caller voice unmuted target"
		if param["settings"]["voicemute_msg_on"] then
			muteOn = param["settings"]["voicemute_msg_on"]
		end
		if param["settings"]["voicemute_msg_off"] then
			muteOff = param["settings"]["voicemute_msg_off"]
		end
		local muteTable = {}
		muteTable["caller"] = getCaller(param[1])
		local targs = string.Explode(" ", param[3])
		for i, targ in pairs(targs) do
			local plyTarg = getPlayerByName(targ)
			if plyTarg then
				muteTable["target"] = plyTarg:GetName()
				local val = plyTarg:GetNWInt("moocow_vmute")
				if (not val) || val == 0 || val == -1 then
					plyTarg:SetNWInt("moocow_vmute", 1)
					plyTarg:ConCommand("-voicerecord")
					display(param[1], "voicemute", { plyTarg } , parseDisplayMessage(muteOn, muteTable))
				else
					plyTarg:SetNWInt("moocow_vmute", -1)
					display(param[1], "voicemute", { plyTarg } , parseDisplayMessage(muteOff, muteTable))
				end
			end
		end
	end)
else
	local function canTalk(ply, bind, pressed)
		if ply:GetNWInt("moocow_vmute") == 1 && string.find(bind, "+voicerecord") then
			return true
		else
			return false
		end
	end
	hook.Add("PlayerBindPress", "CanTalk", canTalk)
end